<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改商品分类')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-category-edit" th:object="${shopProductCategory}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">标题：</label>
                <div class="col-sm-8">
                    <textarea name="title" class="form-control" required>[[*{title}]]</textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">内容描述：</label>
                <div class="col-sm-8">
                    <textarea name="content" class="form-control" rows="4">[[*{content}]]</textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">类型：</label>
                <div class="col-sm-8">
                    <select name="type" th:field="*{type}" class="form-control m-b" required>
                        <option value=""></option>
                        <option value="1">分类</option>
                        <option value="2">标签</option>
                        <option value="3">专题</option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">图标：</label>
                <div class="col-sm-8">
                    <input name="icon" th:field="*{icon}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">排序编码：</label>
                <div class="col-sm-8">
                    <input name="orderNumber" th:field="*{orderNumber}" class="form-control" type="number">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />

    <script th:inline="javascript">
        var prefix = ctx + "product/category";
        $("#form-category-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-category-edit').serialize());
            }
        }

    </script>
</body>
</html>